<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ModifyWoCallback extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasColumn('work_order_callback', 'solved')) {
            return;
        }
        Schema::table('work_order_callback', function (Blueprint $table) {
            $table->unsignedTinyInteger('solved')->after('work_order_id')->default(1)->comment('问题解决情况');
            $table->string('content_check')->after('solved')->default('')->comment('内容核对情况');
            $table->string('satisfaction', 64)->after('content_check')->default(0)->comment('满意度');
            $table->string('target')->after('satisfaction')->default('')->comment('提交人身份');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
